import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import Antd from 'ant-design-vue';
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './assets/main.css'
import dayjs from 'dayjs'
const app = createApp(App)
const pinia = createPinia()
app.use(pinia)
app.use(router)

app.use(Antd)

app.use(ElementPlus)

// 全局日期格式化过滤器
app.config.globalProperties.$filters = {
  formatDate(value) {
    return value ? dayjs(value).format('YYYY-MM-DD HH:mm') : '-'
  },
  formatMoney(value) {
    return value ? `¥${parseFloat(value).toFixed(2)}` : '¥0.00'
  }
}


app.mount('#app')
